#include <iostream>
#include <set>
#include "utf8togbk.h"
using namespace std;

int main()
{
    cout << "hello" << endl;

    set<int> s;

    //插入返回pair<set<int>::iterator, bool>
    pair<set<int>::iterator, bool> ret = s.insert(11111);
    if (ret.second)
    {
        cout << UTF8ToGBK("插入成功:") << *ret.first << endl;
    }
    else
    {
        cout << UTF8ToGBK("插入失败:") << *ret.first << endl;
    }

    for (int i = 0; i < 10; i++)
    {
        s.insert(i);
    }

    set<int>::iterator begin = s.begin();
    set<int>::iterator end = s.end();
    while (begin != end)
    {
        //获取每个元素
        cout << *begin << endl;
        begin++;
    }


    system("pause");
    return 0;
}